<me:UIWBBST x:Class="WPFExcelReport.TWB06"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:VV="clr-namespace:WPFExcelReport;assembly=TVVLIEF" 
                    xmlns:BW="clr-namespace:WPFExcelReport;assembly=TWBBEW" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWBBST.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:KM2YD x:Key="KM2YD"/>
        <ucd:M2YD x:Key="M2YD"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIWBBST.Resources>
    <Grid IsEnabled="{Binding IsBusy,Converter={StaticResource not}}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel  Grid.Row="0" Grid.Column="0" Visibility="{Binding IsCanNew,ElementName=TV,Converter={StaticResource bv}}" >
            <WrapPanel >
                <WrapPanel>
                    <CheckBox Content="{Binding Source={Localization:Translate Word=全屏}}" IsChecked="{Binding IsZoneWBFull,ElementName=TV}" VerticalAlignment="Top"></CheckBox>
                    <Grid Margin="10,0,0,0" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" >原库</TextBlock>
                        <TextBlock Grid.Column="1"  FontSize="18" Foreground="Red"   Text="{Binding SLO,ElementName=TV}" Width="30"/>
                        <TextBlock Grid.Column="2"  FontSize="18" Foreground="Red"   Text="{Binding SLB,ElementName=TV}" Width="30"/>
                    </Grid>
                    <Grid Margin="10,0,0,0" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" >发货单</TextBlock>
                        <ex:TXT72 MaxLength="8" PRE="00000000" Grid.Column="1"  FontSize="18"  KeyUp="LIEFSCH_KeyUp"  Text="{Binding LIEFSCH,ElementName=TV}" Width="120"/>
                    </Grid>
                    <Grid Margin="10,0,0,0" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Grid.Column="1" >取消</TextBlock>
                    </Grid>
                    <Grid Margin="10,0,0,0" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Click="MoveSelectedCommand" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/arrow-reload.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Grid.Column="1" >全部确认</TextBlock>
                    </Grid>
                    <Grid Margin="10,0,0,0"   >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button   Click="BATCHCONFIRM" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Grid.Column="1" >批量确认</TextBlock>
                    </Grid>
                </WrapPanel>
            </WrapPanel>
            <WrapPanel>
                <Grid Margin="10,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" FontSize="24" >当前布卷</TextBlock>
                    <TextBox MaxLength="11" FontSize="24"  Grid.Column="1"  KeyUp="STKNR_KeyUp"  Text="{Binding STKNR,ElementName=TV}" Width="200"/>
                </Grid>
            </WrapPanel>
            <WrapPanel>
                <Grid Margin="10,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0"  FontSize="18" >转移数量M:</TextBlock>
                    <ex:NumericBox  Grid.Column="1" DecimalPlaces="2" FontSize="18" Foreground="Red"  Text="{Binding TargetMTR,ElementName=TV}" Width="80"/>
                    <TextBlock Grid.Column="2" FontSize="18" >YD</TextBlock>
                    <ex:NumericBox  Grid.Column="3" DecimalPlaces="2" FontSize="18" Foreground="Red"  Text="{Binding TargetMTR,ElementName=TV,Converter={StaticResource ResourceKey=M2YD}}" Width="80"/>
                </Grid>
                <Grid Margin="10,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" >目标库</TextBlock>
                    <ex:TXT72 CharacterCasing="Upper" PRE="00" MaxLength="2" Grid.Column="1"  FontSize="18" Foreground="Red"   Text="{Binding LO,ElementName=TV}" Width="40"/>
                    <ex:TXT72 CharacterCasing="Upper" PRE="00" MaxLength="2" Grid.Column="2"  FontSize="18" Foreground="Red"   Text="{Binding LB,ElementName=TV}" Width="40"/>
                    <ex:TXT72 CharacterCasing="Upper"  MaxLength="8" Grid.Column="3"  FontSize="18" Foreground="Red"   Text="{Binding LP,ElementName=TV}" Width="40"/>
                </Grid>
            </WrapPanel>
        </StackPanel>
        <DataGrid  Grid.Row="1" Grid.Column="0" 
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   HorizontalAlignment="Left"
                   RowDetailsVisibilityMode="Visible"  Margin="0,0,0,0"
                    >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=WBBLB}"    Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WBBLP}" Header="{Binding Source={Localization:Translate Word=库位}}"  Width="Auto" /> 
                <DataGridTextColumn   Header="{Binding Source={Localization:Translate Word=小卷号}}"   Binding="{Binding WBBPACKNR}"/>
                <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=格型}}" Binding="{Binding WBBDPART}"/>
                <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=色级}}" Binding="{Binding WBBTAX}"/>
                <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=数量(米)}}" Binding="{Binding WBBISTKLG,Converter={StaticResource ResourceKey=d1000}}"/>
                <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=数量(码)}}" Binding="{Binding WBBISTKLG,Converter={StaticResource ResourceKey=KM2YD}}"/>
                <DataGridTextColumn Binding="{Binding Path=WBBSTKNR,Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=布卷号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WBBISTKLG,Converter={StaticResource d1000}}" Header="{Binding Source={Localization:Translate Word=数量(米)}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WBBAUFKRS}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WBBAUFLFD,Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=销售单}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WBBAUFPOS,Converter={StaticResource pnum}}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WBBALIEFSCH,Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=发货单}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
        <ex:TPage  Grid.Row="2" Visibility="{Binding IsPage,Converter={StaticResource bv}}"/>
        <WrapPanel Grid.Row="3">
            <TextBlock Text="{Binding Source={Localization:Translate Word=总数量:}}"  Margin="20,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM1, Converter={StaticResource d1000}}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
            <TextBlock Text="{Binding Source={Localization:Translate Word=米}}"  Margin="20,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM1, Converter={StaticResource KM2YD}}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
            <TextBlock Text="{Binding Source={Localization:Translate Word=码}}"  Margin="20,0,0,0"></TextBlock>
            <TextBlock Text="{Binding Source={Localization:Translate Word=总卷数:}}"  Margin="20,0,0,0"></TextBlock>
            <TextBlock Text="{Binding Counts}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
        </WrapPanel>
    </Grid>
</me:UIWBBST>
